<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderAuditLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_audit_logs', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('自增ID');

            $table->unsignedTinyInteger('type')->default(0)->comment('类型 1、场馆预约 2、活动预约 3、志愿服务');

            $table->unsignedBigInteger('res_id')->comment('关联相关id')->index();
            $table->unsignedBigInteger('audit_user_id')->comment('预约人id')->index();

            $table->integer('status')->default(1)->comment('状态: 0已点 1显示');
            $table->unsignedTinyInteger('audit_status')->default(0)->comment('审核后状态 0:待审核 1:已审核 2:拒绝 3:取消');

            $table->unsignedBigInteger('audit_admin_uid')->comment('审核人uid')->index();

            $table->timestamps();
            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
        DB::statement("alter table `order_audit_logs` comment'审核日志表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_audit_logs');
    }
}
